package com.dc.project.entity.dto;

import com.dc.project.entity.bo.TemplateDetailAttachmentBo;
import com.own.component.common.base.entity.BaseDto;
import com.own.constant.ConstantBeanSuffix;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.io.Serializable;

/**
 * TemplateDetailAttachmentDto
 *
 * @author chenxueli
 * @date 2025-03-19 13:23:08
 */
@Schema(title = "模板详情附件" + ConstantBeanSuffix.DTO)
@Getter
@Setter
@ToString
@Accessors(chain = true)
@AllArgsConstructor
@NoArgsConstructor
public class TemplateDetailAttachmentDto extends BaseDto<TemplateDetailAttachmentBo> implements Serializable {

    @Schema(title = "模板详情id")
    private Long templateDetailId;

    @Schema(title = "附件id")
    private Long attachmentId;

    @Schema(title = "附件名称")
    private String attachmentName;

    @Schema(title = "附件路径")
    private String attachmentPath;

    @Schema(title = "附件提示语")
    private String attachmentPrompt;

    /**
     * 转业务层对象
     *
     * @param entity 原业务层对象
     * @return 业务层对象
     */
    @Override
    public TemplateDetailAttachmentBo toBo(TemplateDetailAttachmentBo entity) {
        if (entity == null) {
            entity = new TemplateDetailAttachmentBo();
        }
        entity.setTemplateDetailId(this.templateDetailId);
        entity.setAttachmentId(this.attachmentId);
        entity.setAttachmentName(this.attachmentName);
        entity.setAttachmentPath(this.attachmentPath);
        entity.setAttachmentPrompt(this.attachmentPrompt);
        return super.toBo(entity);
    }

}

